/*
  This file is part of 'Trivial chess'.

  'Trivial chess' is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  'Trivial chess' is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with 'Trivial chess'.  If not, see <http://www.gnu.org/licenses/>.
*/

/* SVN FILE: $Id$ */
/**
 * @author         $Author$
 * @version        $Rev$
 * @lastrevision   $Date$
 * @filesource     $URL$
 */

#ifndef SQUAREORD_H_
#define SQUAREORD_H_

#include <boost/cstdint.hpp>

#include "SquareAbstract.h"
#include "../OrdAbstract.h"

template<class F, class R, typename Int = int8_t>
class SquareOrd
	: public SquareAbstract<SquareOrd,F,R,Int>
	, public OrdAbstract<SquareOrd<F,R,Int>,F,R,Int,3> {
public:
		SquareOrd<F,R,Int>()
		: OrdAbstract<SquareOrd,F,R,Int,3>() {}

	explicit SquareOrd<F,R,Int>(const Int man)
		: OrdAbstract<SquareOrd,F,R,Int,3>(man) {}

	explicit SquareOrd<F,R,Int>(const std::string str)  {
		this->me().fromStr(str);
	}

	SquareOrd<F,R,Int>(const File file, const Rank rank)
		: OrdAbstract<SquareOrd,F,R,Int,3>(file, rank) {}

	const File file() const { return this->me_c().fst(); }
	const Rank rank() const { return this->me_c().scd(); }

	void setFile(const File file) { this->me().setFst(file); }
	void setRank(const Rank rank) { this->me().setScd(rank); }
};

#endif /* SQUAREORD_H_ */
